% Function implementing equality constraints
function y = cloth_ineqconstr_plane(array,Restlength,D,m,g)

% Convert array to 3d tensor
tensor = array2tensor(array);
N=length(tensor(:,1,1));

Aineq=kron(eye(N^2),[0 0 1]);
Bineq=kron(ones(N,1),linspace(-1,1,N)');

y=-Aineq*array+Bineq;
% norm=sum(tensor.^2,3).^.5;
% y=reshape(2-norm,[],1);

% y=squeeze(tensor(:,:,3))-0.5*ones(N);
% y=reshape(y,[],1);